package com.oolatina.activity;

import java.util.ArrayList;

import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.content.Context;
import android.os.Bundle;
import android.view.Display;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import android.view.WindowManager;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.util.Log;
import android.util.TypedValue;

import newspackage.APIParser;
import newspackage.NewsBean;
import newspackage.WebServices;

import org.json.JSONObject;

import cc.ImageLoader2;

import com.loopj.android.http.AsyncHttpResponseHandler;
import com.oolatina.R;
import com.oolatina.adapters.NewsAdapter;

public class NewsDetail extends ActionBarActivity {
	OOLatinaApplication oolatina;
	ArrayList<NewsBean> newsList;
	ImageView image;
	TextView newsTitle, newsDetail;
	String title, detail, url;
	public ImageLoader2 imageLoader;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.news_detail);
		WindowManager wm = (WindowManager) this
				.getSystemService(Context.WINDOW_SERVICE);
		Display display = wm.getDefaultDisplay();
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

		newsTitle = (TextView) findViewById(R.id.newTitleD);
		newsDetail = (TextView) findViewById(R.id.newsDetailD);
		image = (ImageView) findViewById(R.id.newsImageD);
		imageLoader = new ImageLoader2(NewsDetail.this);

		Bundle in = getIntent().getExtras();
		title = in.getString("title");
		detail = in.getString("detail");
		url = in.getString("url");

		newsTitle.setText(title);
		newsDetail.setText(detail);
		imageLoader.DisplayImage(url, image);

	}

}
